/**
 * author:Administrator
 * date:2016/2/24
 * desc:TODO
 */
'use strict';


let seq = 1;
let list = {};

class ShopRepoImpl {

  static * genId() {
    return 'shop_' + (seq++);
  }

  static * find(id) {
    return list[id];
  }

  static *store(shop) {
    if (!shop.id) shop.id = yield ShopRepoImpl.genId();
    list[shop.id] = shop;
  }

}

module.exports = ShopRepoImpl;